/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-10 08:35:29  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_bp_monitoring_point_rel")
public class BpMonitoringPointRel implements java.io.Serializable{

    //columns START
    //
    private Long id;
    //
    private String refType;
    //
    private Long refId;
    //
    private Long monitoringPointId;
    //租户ID
    private Long tenentId;
    //组织机构代码
    private String orgCode;
    //columns END


    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }


    @Column(name = "REF_TYPE", length = 20, nullable = false)
    public String getRefType() {
        return this.refType;
    }

    public void setRefType(String value) {
        this.refType = value;
    }


    @Column(name = "REF_ID", nullable = false)
    public Long getRefId() {
        return this.refId;
    }

    public void setRefId(Long value) {
        this.refId = value;
    }


    @Column(name = "MONITORING_POINT_ID", nullable = false)
    public Long getMonitoringPointId() {
        return this.monitoringPointId;
    }

    public void setMonitoringPointId(Long value) {
        this.monitoringPointId = value;
    }


    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }


    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }


    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id",getId())
            .append("refType",getRefType())
            .append("refId",getRefId())
            .append("monitoringPointId",getMonitoringPointId())
            .append("tenentId",getTenentId())
            .append("orgCode",getOrgCode())
            .toString();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }

    public boolean equals(Object obj) {
        if(obj instanceof BpMonitoringPointRel == false) return false;
        if(this == obj) return true;
        BpMonitoringPointRel other = (BpMonitoringPointRel)obj;
        return new EqualsBuilder()
            .append(getId(),other.getId())
            .isEquals();
    }
}

